import {ComponentOptions} from "vue/types/options";
import {TableItemConfig} from "../TableType";
import {DynamicTable} from "../index.vue.d";

export const CommonMixin: ComponentOptions<any> = {
  methods: {
    itemShow(item: TableItemConfig, vm: DynamicTable) {
      if (item.hidden) {
        return false
      }
      const value = item.setHidden?.(vm.data || [], item) || false
      return !value
    },
  }
}
